//
//  NetworkTools.swift
//  超杰的新浪微博
//
//  Created by mac on 15/8/6.
//  Copyright © 2015年 ios. All rights reserved.
//

import UIKit
import AFNetworking

class NetworkTools: AFHTTPSessionManager {
    
    //单利
    static let sharedTools: NetworkTools = {
    
        let baseURL = NSURL(string:"https://api.weibo.com/")
        let tools = NetworkTools(baseURL: baseURL)
        return tools
    }()
    //授权
    private let clientId = "2807055281"
    private let appSecret = "5da8f57425e45a3da7f4a482204dce1a"
    private let redirecUri = "http://www.baidu.com"

    //返回OAuth
    func oauthUrl() -> NSURL{
    
        let urlString = "https://api.weibo.com/oauth2/authorize?client_id=\(clientId)&redirecUri=\(redirecUri)"
        return NSURL(string: urlString)!
    }
}
